//
//  UserAccount.h
//  weibo
//
//  Created by hp on 16/4/28.
//  Copyright © 2016年 hp. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface UserAccount : NSObject<NSCoding>

@property (nonatomic, copy) NSString *access_token;
@property (nonatomic, assign) int expires_in; // 过期时间，过多少秒，令牌过期
@property (nonatomic, copy) NSString *uid;

@property (nonatomic, copy) NSString *screen_name;
@property (nonatomic, copy) NSString *avatar_large;
@property (nonatomic, strong) NSDate *expire_date; // 过期时间

- (instancetype)initWithDictionary:(NSDictionary *)dic;
+ (instancetype)userAccountDictionary:(NSDictionary *)dic;

+ (instancetype)sharedUserAccount;
- (void)requestUserInfoSuccessBlock:(void(^)(UserAccount *account))successfulBlock
                        failedBlock:(void(^)(NSError *error))failedBlock;

- (BOOL)isLogined;
@end
